let promise = new Promise((resolve, reject) => {
  resolve("success");
  reject("fail");
});
promise.then(
  (res) => {
    console.log(res);
  },
  (error) => {
    console.log(error);
  }
);
